<!DOCTYPE html>
<html lang="zh-cn"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Document</title>
    <link rel="stylesheet" href="../../build/css/ztree/metro/ztree.css" media="all" >
    <link rel="stylesheet" href="../../build/css/treeselect.css" media="all" >
    <link rel="stylesheet" href="../../plugins/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../plugins/font-awesome/css/font-awesome.min.css" media="all">
</head>

<body>
<div  class="layui-row"  style="margin-top: 5px;margin-left: 5px">
    <div class="layui-col-md12 userListToolbar">
        <span>数据操作:</span>
        <div class="layui-btn-group">
            <button class="layui-btn layui-btn-sm" data-type="batchAudit" shiro:hasPermission="upms:users:user:audit">
                审核
            </button>
            <button class="layui-btn layui-btn-sm" data-type="batchForbidden" shiro:hasPermission="upms:users:user:audit">
                禁用
            </button>
        </div>
        <span style="margin-left: 5px">数据查询:</span>
        <div class="layui-inline">
            <span>用户类型:</span>
                <input type="radio" name="locked" value="-1" title="全部" checked>全部
                <input type="radio" name="locked" value="0" title="未审核">未审核
                <input type="radio" name="locked" value="1" title="已审核">已审核
            </div>
        <div class="layui-inline">
            <input class="layui-input" name="searchKey" id="searchKey" autocomplete="off">
        </div>
        <button class="layui-btn" data-type="reload">搜索</button>
    </div>
</div>
<div  class="layui-row">
    <div class="layui-col-md12">
        <table id="userList" lay-filter="userList"></table>
    </div>
</div>
<div id="updateUserDiv" class="layui-field-box layui-row" style="display: none;">
    <div class="layui-col-md8">
        <div class="layui-form" action="" method="post" lay-filter="updateUserFilter" >
            <fieldset class="layui-elem-field"  style="padding-top:15px;padding-left: 15px;margin-left: 15%">
                <legend>用户级别信息</legend>
                <div class="layui-form-item layui-form-pane">
                    <div class="layui-inline">
                        <label class="layui-form-label" style="color:#F00">编号</label>
                        <div class="layui-input-block">
                            <input type="text" name="id"  autocomplete="off" class="layui-input" readonly>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="color:#F00">账号</label>
                        <div class="layui-input-block">
                            <input type="text" name="username" autocomplete="off" class="layui-input" readonly>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item layui-form-pane">
                    <div class="layui-inline">
                        <label class="layui-form-label" style="color:#F00">姓名</label>
                        <div class="layui-input-block">
                            <input type="text" name="realname"  autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="color:#F00">电话</label>
                        <div class="layui-input-block">
                            <input type="text" name="phone" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item layui-form-pane">
                    <div class="layui-inline">
                        <label class="layui-form-label" style="color:#F00">邮箱</label>
                        <div class="layui-input-block">
                            <input type="text" name="email"  autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="color:#F00">性别</label>
                        <div class="layui-input-block">
                            <input type="radio" name="sex" title="男" value="1">
                            <input type="radio" name="sex" title="女" value="0">
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-pane">
                        <label class="layui-form-label" style="color:#F00">部门</label>
                        <div class="layui-input-block layui-input-treeselect">
                            <input type="text" name="deptId"  required autocomplete="off"  class="layui-input" id="deptSelectTree" >
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-pane">
                        <div class="layui-inline">
                            <label class="layui-form-label" style="color:#F00">是否锁定</label>
                            <div class="layui-input-block">
                                <input type="checkbox" name="locked" id="locked"  title="是否锁定">
                            </div>
                        </div>
                    </div>
                </div>
            </fieldset>
            <div class="layui-form-item" style="margin-left: 30%">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="updateUserSubmit">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="roleTableDiv" class="layui-field-box layui-row" style="display: none;">
    <div  class="layui-row userListToolbar">
        <button class="layui-btn layui-btn-normal" data-type="saveUserRoles">保存角色</button>
    </div>
    <hr class="layui-bg-red">
    <div  class="layui-row" style="width: 600px">
        <table id="roles" lay-filter="roles"></table>
    </div>
</div>
<div id="privatePermissionTree" style="display: none">
    <div style="margin-top:5px;margin-left: 5px" class="userListToolbar">
        <button type="reset" class="layui-btn layui-btn-normal" data-type="savePrivatePermission">保存权限</button>
    </div>
    <hr class="layui-bg-red">
    <div>
        <ul id="permissionTree" class="ztree"></ul>
    </div>
</div>
<script type="text/html" id="setTpl">
    <!-- 性别控件 -->
    {{#  if(d.sex === 1){ }}
        <span class="layui-badge layui-bg-blue">男</span>
    {{#  } else { }}
        <span class="layui-badge">女</span>
    {{#  } }}
</script>
<script type="text/html" id="lockedTpl">
    <!-- 是否审核控件 -->
    <input type="checkbox" name="{{d.id}}" value="{{d.locked}}" title="审核通过" lay-filter="isLocked" {{ d.locked == 1 ? 'checked' : '' }}>
</script>
<shiro:hasAllPermissions  name="upms:users:users:edit,upms:users:users:assginRoles,upms:users:users:assginPermissions">
    <script type="text/html" id="userListTableBar">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-xs" lay-event="assassinRoles">分配角色</a>
        <a class="layui-btn layui-btn-xs" lay-event="assassinPermission">分配权限</a>
    </script>
</shiro:hasAllPermissions >
<shiro:hasAllPermissions  name="upms:users:users:edit,upms:users:users:assginRoles">
    <script type="text/html" id="userListTableBar">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-xs" lay-event="assassinRoles">分配角色</a>
    </script>
</shiro:hasAllPermissions >
<shiro:hasAllPermissions  name="upms:users:users:edit,upms:users:users:assginPermissions">
    <script type="text/html" id="userListTableBar">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-xs" lay-event="assassinPermission">分配权限</a>
    </script>
</shiro:hasAllPermissions >
<shiro:hasAllPermissions  name="upms:users:users:assginRoles,upms:users:users:assginPermissions">
    <script type="text/html" id="userListTableBar">
        <a class="layui-btn layui-btn-xs" lay-event="assassinRoles">分配角色</a>
        <a class="layui-btn layui-btn-xs" lay-event="assassinPermission">分配权限</a>
    </script>
</shiro:hasAllPermissions >
<script src="../../plugins/layui/layui.js"></script>
<script src="../../businessJs/userList.js"></script>
</body>

</html>